<template>
  <div class="logForm">
    <el-dialog
      :title="dialogTitle"
      :visible.sync="dialogVisible"
      width="35%"
    >
      <el-form ref="formData" :model="formData" label-width="100px" style="padding:0px 40px" >
        <el-row>
          <el-col :span="12">
            <el-form-item label="日志编号：" prop="logId">
              <el-input v-model="formData.logId" readonly />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="操作账号：" prop="operatorAccount">
              <el-input v-model="formData.operatorAccount" readonly />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="操作地址：" prop="remoteAddress">
              <el-input v-model="formData.remoteAddress" readonly />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="操作时间：" prop="createTime">
              <el-input v-model="formData.createTime" readonly />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="操作模块：" prop="operateModule">
              <el-input v-model="formData.operateModule" readonly />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="操作类型：" prop="logType">
              <el-input v-model="formData.logType" readonly />
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="操作信息：">
          <el-input v-model="formData.logInfo" type="textarea" :autosize="{ minRows: 3, maxRows: 5}" readonly />
        </el-form-item>
        <el-form-item label="修改前数据：">
          <el-input v-model="formData.dataBeforeUpdate" type="textarea" :autosize="{ minRows: 3, maxRows: 5}" readonly />
        </el-form-item>
        <el-form-item label="修改后数据：">
          <el-input v-model="formData.dataAfterUpdate" type="textarea" :autosize="{ minRows: 3, maxRows: 5}" readonly />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="closeDialog">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'LogForm',
  data() {
    return {
      dialogTitle: '日志',
      formDialogType: '',
      dialogVisible: false,
      // 表单数据
      formData: {
        logId: null,
        operatorAccount: '',
        remoteAddress: '',
        createTime: '',
        operateModule: '',
        logType: '',
        logInfo: '',
        dataBeforeUpdate: '',
        dataAfterUpdate: ''
      }
    }
  },
  mounted() {
  },
  methods: {
    // 点击新增或者编辑
    is(type, data) {
      this.dialogVisible = true
      this.dialogTitle = '日志详细'
      this.formDialogType = type
      this.formData = data
    },
    closeDialog() {
      this.$emit('closeForm')
      this.dialogVisible = false
    }
  }
}
</script>

<style lang="less" scoped>
.logForm{
  height:99%;
      /deep/label{
    font-weight: 500;
  }
}
</style>
